package com.meida.module.bus.client.enums;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.NoArgsConstructor;

/**
 * 会员卡来源
 *
 * @author jzy
 * @date 2021/7/9
 */
@NoArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum UserGoodsSourceTypeEnum {

    saoMaZhuCe(1, "扫码注册"),
    shangChengGouMai(2, "商城购买"),
    xiaoShouXinZheng(3, "销售新增"),
    houTaiXinZheng(4, "后台新增"),
    houTaiDaoRu(5, "后台导入"),
    liPinKaJieShou(6, "礼品卡接收"),
    houTaiPiLiang(7, "后台批量生成"),
    xiaoShouZhengSong(8, "销售赠送"),
    daiLiShang(9, "代理商下单"),
    qiYeXiaDan(10, "企业下单");

    private Integer userGoodsSourceType;

    @ApiModelProperty("描述")
    private String label;

    UserGoodsSourceTypeEnum(Integer userGoodsSourceType, String label) {
        this.userGoodsSourceType = userGoodsSourceType;
        this.label = label;
    }

    public Integer getUserGoodsSourceType() {
        return userGoodsSourceType;
    }

    public void setUserGoodsSourceType(Integer userGoodsSourceType) {
        this.userGoodsSourceType = userGoodsSourceType;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public static UserGoodsSourceTypeEnum getByValue(Integer value) {
        for (UserGoodsSourceTypeEnum userGoodsSourceTypeEnum : values()) {
            if (userGoodsSourceTypeEnum.getUserGoodsSourceType() == value) {
                return userGoodsSourceTypeEnum;
            }
        }
        return null;
    }
}
